<template>
  <div>购物车页面
    <ul>
      <li v-for="(item,index) in goods" :key="index">
        <span>{{item.sku_name}}</span>
        <span>{{item.min}}</span>
        <span>{{item.num}}</span>
        <span></span>
      </li>
    </ul>
  </div>
</template>

<script>
//引入辅助函数
import {mapState} from "vuex";

export default {
 name:"cart",
 computed:{
   ...mapState(["goods"]),
   //使用辅助函数后以下这几步不用写
  //  goods(){
  //    return this.$store.state.goods;
  //  }
 }
}
</script>

<style scoped>
span {
  margin-left: 10px;
}
</style>